import request from "@/router/axios"

export const getCommonPage = (url, page, params) => {
  return request({
    url,
    method: 'get',
    params: {
      ...page,
      ...params,
    }
  })
}

export const commonSubmit = (url, form) => {
  return request({
    url,
    method: 'post',
    data: {
      ...form
    }
  })
}

export const commonRemove = (url, id) => {
  return request({
    url,
    method: 'post',
    params: {
      ids: id
    }
  })
}

export const postParams = (url, params) => {
  return request({
    url,
    method: 'post',
    params
  })
}

export const postData = (url, data) => {
  return request({
    url,
    method: 'post',
    data
  })
}

export const putData = (url, data) => {
  return request({
    url,
    method: 'put',
    data
  })
}

export const getParams = (url, params) => {
  return request({
    url,
    method: 'get',
    params
  })
}

